
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">


        <title>Đăng nhâp hệ thống</title>

        <!-- Stylesheets -->
        <link href="<?php echo WEB_PATH_HEADER; ?>loginadmin/css/bootstrap.min.css" rel="stylesheet">
        <link href="<?php echo WEB_PATH_HEADER; ?>loginadmin/css/preview.css" rel="stylesheet">
        <link href="<?php echo WEB_PATH_HEADER ?>loginadmin/css/authenty.css" rel="stylesheet">

        <!-- Font Awesome CDN -->
        <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

        <!-- Google Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700,300' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>


        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
    <body style="overflow:hidden;">
        <section id="authenty_preview">
            <section id="signin_main" class="authenty signin-main">
                <div class="section-content">
                    <div class="wrap">
                        <div class="container" >	  
                            <div class="form-wrap">
                                <div class="row"  id="loadlogin">

                                    <div id="form_1">
                                        <div class="form-header">
                                            <i class="fa fa-user"></i>
                                        </div>
                                        <div class="form-main">

                                            <div class="form-group">
                                                <input type="text" id="username" class="form-control" placeholder="Nhập tên tài khoản" required="required">
                                                <input type="password" id="password" class="form-control" placeholder="Nhập mật khẩu" required="required">
                                            </div>
                                            <button onclick="checklogin();" id="signIn_1" type="submit" class="btn btn-block signin">Đăng nhập</button>

                                        </div>
                                        <div class="form-footer">
                                            <div class="row">
                                                <i id="meslogin" style="color: #FFF">

                                                </i>
                                            </div>
                                        </div>		
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <input type="hidden" value="<?php echo WEB_PATH; ?>cpadmin.fy" id="url"/>
        </section>	  
        <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
        <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
        <script src="<?php echo WEB_PATH_HEADER; ?>loginadmin/js/bootstrap.min.js"></script>
        <script>
                                                    function checklogin() {
                                                        var username = $("#username").val();
                                                        var password = $("#password").val();
                                                         
                                                        $.ajax({
                                                            url: $("#url").val(),
                                                            cache: false,
                                                            type: "POST",
                                                            data: "actiondo=checklogin&username=" + username + "&password=" + password,
                                                            success: function(serverData) {
                                                                var arrdata = serverData.split("*codebyduypc*");
                                                                
                                                                if (arrdata[0] == "loginfail") {
                                                                    $("#loadlogin").toggle("shake");
                                                                    $("#loadlogin").toggle("shake");
                                                                    $("#meslogin").html("Tên đăng nhập hoặc mật khẩu không chính xác.");
                                                                } else {
                                                                    alert("OK");
                                                                   // var url = arrdata[1];
                                                                    //$(location).attr('href', url);
                                                                }
                                                            }
                                                        });
                                                        return false;
                                                    }
        </script>
    </body>
</html>